package cn.iocoder.yudao.module.trade.job;

import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageRecordService;
import cn.iocoder.yudao.module.trade.service.order.TradeOrderUpdateService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@EnableScheduling
@Slf4j
@Component
public class MyScheduled {

    @Resource
    private TradeOrderUpdateService tradeOrderUpdateService;

    @Resource
    private BrokerageRecordService brokerageRecordService;

    @Scheduled(cron = "0 0 2 * * ?")
    public void FillCallback() {
        int count = tradeOrderUpdateService.receiveOrderBySystem();
        log.info("执行定时任务-自动收货 {} 个",count);
    }



    @Scheduled(cron = "0 0/5 * * * ?")
    public void unfreeze() {
        // 解冻佣金，check
        int count = brokerageRecordService.unfreezeRecord();
        log.info("解冻佣金 {} 个", count);
    }


}
